package com.woniuxy.oa.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.woniuxy.oa.entity.GoodsRepository;
import com.woniuxy.oa.mapper.GoodsRepositoryMapper;
import com.woniuxy.oa.service.GoodsRepositoryService;
@Service
public class GoodsRepositoryServiceImpl implements GoodsRepositoryService{
	
	@Autowired
	GoodsRepositoryMapper goodsRepositoryMapper;

	@Override
	public List<GoodsRepository> getAllGoodsRepositorys() {
		List<GoodsRepository> goodsRepositorys = goodsRepositoryMapper.selectAllGoodsRepositorys();
		return goodsRepositorys;
	}

	@Override
	public void addGoodsRepository(String gp_name, Integer gp_number,Integer gp_id) {
		goodsRepositoryMapper.insertGoodsRepository(gp_name, gp_number,gp_id);
		
	}

	@Override
	public Integer getGr_numberByGr_name(String gc_name) {
		Integer gr_number = goodsRepositoryMapper.selectGr_numberByGr_name(gc_name);
		return gr_number;
	}
	//申购同种物品增加库存数量
	@Override
	public void modifyAddGr_numberByGr_name(Integer gp_number, String gp_name) {
		goodsRepositoryMapper.updateAddGr_numberByGr_name(gp_number, gp_name);
		
	}
	



}
